<% layout('/layouts/default.html', {title: '数据管理', libs:
['validate','fileupload','ueditor','dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> 编辑售后
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool"
						data-widget="collapse">
					<i class="fa fa-minus"></i>
				</button>
			</div>
		</div>

		<#form:form id="inputForm" model="${ztAfterSale}"
		action="${ctx}/ztAfterSale/save" method="post"
		class="form-horizontal">
		<div class="box-body">
			<div class="form-unit">${text('订单信息')}</div>
			<#form:hidden path="id"/>
			<#form:hidden path="order"/>
			<#form:hidden path="adminId"/>
			<#form:hidden path="type"/>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
								class="required"></span> ${text('物流名称')}：<i
								class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							${ztAfterSale.expressCompany}
						</div>

					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
								class="required hide">*</span> ${text('物流单号')}：<i
								class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							${ztAfterSale.expressCode}

							<input id="retrieval" onclick="openWin('${ctx}/ztWl/list?logistics=${ztAfterSale.expressCode}&logisticsCode=${ztAfterSale.expressCode}', 900, 600)"
								   class="btn btn-primary" type="button" style="background:#00B2EE;margin-top: 4px;" value="查看物流信息" />
						</div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
								class="required">*</span> ${text('渠道')}：<i
								class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="spotid" dictType="zt_spotid_type" blankOption="true" class="form-control width-80" disabled="disabled"/>
							<#form:hidden path="spotid"/>
						</div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
								class="required hide">*</span> ${text('商品名')}：<i
								class="fa icon-question hide"></i></label>
						<div class="col-sm-8">${ztAfterSale.wareName}</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
								class="required">*</span> ${text('商品图片')}：<i
								class="fa icon-question hide"></i></label>
						<div class="col-sm-8">${ztAfterSale.img}</div>
					</div>
				</div>

			</div>

			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
								class="required hide">*</span> ${text('申请数量')}：<i
								class="fa icon-question hide"></i></label>
						<div class="col-sm-8">${ztAfterSale.num}</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
								class="required">*</span> ${text('服务环节')}：<i
								class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<%if(ztAfterSale.afsServiceStep==50||ztAfterSale.afsServiceStep==60){%>
							   <#form:select path="afsServiceStep" dictType="zt_afsServiceStep_type" blankOption="true" class="form-control width-80" disabled="disabled"/>
							<%}else{%>
							   <#form:select path="afsServiceStep" dictType="zt_afsServiceStep_type" blankOption="true" class="form-control width-80"/>
							<%}%>
						</div>
					</div>
				</div>

			</div>

			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
								class="required">*</span> ${text('售后类型')}：<i
								class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<% if(ztAfterSale.type==10){
							 %>退货<%
							}else if (ztAfterSale.type==20){
							         %>换货<%
							} else { %>维修<%}

							%>

						</div>

					</div>
				</div>

				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
								class="required">*</span> ${text('返件方式')}：<i
								class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<% if(ztAfterSale.takeType==4){
							%>上门取件<%
							}else if (ztAfterSale.takeType==7){
							%>客户送货<%
							} else {%>上门取件<%}%>
						</div>

					</div>
				</div>

			</div>

			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
								class="required">*</span> ${text('描述')}：<i
								class="fa icon-question hide"></i></label>
						<div class="col-sm-8">${ztAfterSale.questionDesc}</div>

					</div>
				</div>

				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
								class="required">*</span> ${text('图片')}：<i
								class="fa icon-question hide"></i></label>
						<div class="col-sm-8">${ztAfterSale.questionPic}</div>

					</div>
				</div>

			</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
									class="required hide">*</span> ${text('寄件时间')}：<i
									class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								${ztAfterSale.deliverDate,dateFormat="yyyy-MM-dd HH:mm:ss"}</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
									class="required hide">*</span> ${text('申请时间')}：<i
									class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								${ztAfterSale.createDate,dateFormat="yyyy-MM-dd HH:mm:ss"}</div>
						</div>
					</div>
				</div>





			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<%if(ztAfterSale.afsServiceStep!=50){%>
						<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit">
							<i class="fa fa-check"></i> ${text('保存')}
						</button>
						<%}%>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel"
								onclick="js.closeCurrentTabPage()">
							<i class="fa fa-reply-all"></i> ${text('关 闭')}
						</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>


<script>
	function openWin(u, w, h) {
		var l = (screen.width - w) / 2;
		var t = (screen.height - h) / 2;
		var s = 'width=' + w + ', height=' + h + ', top=' + t + ', left=' + l;
		s += ', toolbar=no, scrollbars=no, menubar=no, location=no, resizable=no';
		open(u, 'oWin', s);
	}


	$("#inputForm").validate({
		submitHandler : function(form) {
			js.ajaxSubmitForm($(form), function(data) {
				js.showMessage(data.message);
				if (data.result == Global.TRUE) {
					js.closeCurrentTabPage(function(contentWindow) {
						contentWindow.page();
					});
				}
			}, "json");
		}
	});
</script>